/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ChArFaTo
 */
@Entity
@Table(name = "habilitacion", catalog = "proyectosw", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HabilitacionEJB.findAll", query = "SELECT h FROM HabilitacionEJB h"),
    @NamedQuery(name = "HabilitacionEJB.findByHId", query = "SELECT h FROM HabilitacionEJB h WHERE h.hId = :hId"),
    @NamedQuery(name = "HabilitacionEJB.findByHFechaInicio", query = "SELECT h FROM HabilitacionEJB h WHERE h.hFechaInicio = :hFechaInicio"),
    @NamedQuery(name = "HabilitacionEJB.findByHFechaFin", query = "SELECT h FROM HabilitacionEJB h WHERE h.hFechaFin = :hFechaFin")})
public class HabilitacionEJB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer hId;
    @Size(max = 255)
    @Column(length = 255)
    private String hFechaInicio;
    @Size(max = 255)
    @Column(length = 255)
    private String hFechaFin;
    @OneToMany(mappedBy = "habilitacionHId")
    private Collection<HistorialnotaEJB> historialnotaEJBCollection;

    public HabilitacionEJB() {
    }

    public HabilitacionEJB(Integer hId) {
        this.hId = hId;
    }

    public Integer getHId() {
        return hId;
    }

    public void setHId(Integer hId) {
        this.hId = hId;
    }

    public String getHFechaInicio() {
        return hFechaInicio;
    }

    public void setHFechaInicio(String hFechaInicio) {
        this.hFechaInicio = hFechaInicio;
    }

    public String getHFechaFin() {
        return hFechaFin;
    }

    public void setHFechaFin(String hFechaFin) {
        this.hFechaFin = hFechaFin;
    }

    @XmlTransient
    public Collection<HistorialnotaEJB> getHistorialnotaEJBCollection() {
        return historialnotaEJBCollection;
    }

    public void setHistorialnotaEJBCollection(Collection<HistorialnotaEJB> historialnotaEJBCollection) {
        this.historialnotaEJBCollection = historialnotaEJBCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hId != null ? hId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HabilitacionEJB)) {
            return false;
        }
        HabilitacionEJB other = (HabilitacionEJB) object;
        if ((this.hId == null && other.hId != null) || (this.hId != null && !this.hId.equals(other.hId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelo.HabilitacionEJB[ hId=" + hId + " ]";
    }
    
}
